/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interpreter.Function;

import Interpreter.InterpreterVisitor;
import ast.AST;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Stephen
 */
public class IsBooleanFunction extends Function{
    @Override
    public Object execute(ArrayList args) {
        
        Object var = ((AST)args.get(0)).accept(new InterpreterVisitor());
        try {
            return (var.getClass() == Class.forName("java.lang.Boolean"));
                
    
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(IsBooleanFunction.class.getName()).log(Level.SEVERE, null, ex); 
        }
        return false;
    }
}
